package com.yuw.oop.constructors;

public class Student extends Person {

	// 属性
	private String stuNo;

	// 行为
	/**
	 * 学习行为
	 */
	public void doStuding() {
		System.out.println(this.getPerName() + " is studing...");
	}

	/////// 构造方法///////
	public Student(String stuNo) {
		this.stuNo = stuNo;
		System.out.println("执行了子类Student的带一个参数的构造方法....");
	}

	public Student(String perName, String perSex, int perAge, String stuNo) {
		// 通过调用父类的构造方法，来初始化子类无法继承到的父类的私有属性
		super(perName, perSex, perAge);
		// 通过调用从父类继承到的set方法接口，来初始化子类无法继承到父类的私有属性
		// this.setPerName(perName);
		// this.setPerSex(perSex);
		// this.setPerAge(perAge);

		this.stuNo = stuNo;
		System.out.println("执行了子类Student的带四个参数的构造方法....");
	}

	public Student() {
		System.out.println("执行了子类Student的默认构造方法....");
	}

	public String getStuNo() {
		return stuNo;
	}

	public void setStuNo(String stuNo) {
		this.stuNo = stuNo;
	}

}
